<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('新增货架设置')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-shelfInfo-add">

			<div class="form-group">	
				<label class="col-sm-3 control-label">货架编码：</label>
				<div class="col-sm-8">
					<input id="shelfCode" name="shelfCode" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">货架名：</label>
				<div class="col-sm-8">
					<input id="shelfName" name="shelfName" class="form-control" type="text">
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-3 control-label">货区：</label>
				<div class="col-sm-8">
					<select id="areaId" name="areaId" class="form-control" >
						<option v-for="area in areas" v-bind:value="area.areaId">{{area.areaName}}</option>
					</select>
				</div>
			</div>


			<div class="form-group">
				<label class="col-sm-3 control-label">行：</label>
				<div class="col-sm-8">
					<input id="shelfRow" name="shelfRow" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">列：</label>
				<div class="col-sm-8">
					<input id="shelfColumn" name="shelfColumn" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">备注：</label>
				<div class="col-sm-8">
					<input id="memo" name="memo" class="form-control" type="text">
				</div>
			</div>

		</form>
	</div>
    <div th:include="include::footer"></div>
    <script type="text/javascript">
		var prefix = ctx + "system/shelfInfo"

		
		function submitHandler() {
	        if ($.validate.form()) {
	            $.operate.save(prefix + "/add", $('#form-shelfInfo-add').serialize());
	        }
	    }


		var app = new Vue({
			el: '.wrapper',
			data: {
				message: 'Hello Vue!',
				areas:[]
			},
			methods:{


				getAreas:function(){

					var that = this;
					$.ajax({
						cache : true,
						type : "POST",
						url :  "/system/areaInfo/list",
						data : {

						},
						async : false,
						error : function(request) {
							$.modal.alertError("系统错误");
						},
						success : function(data) {

							that.areas = data.rows;
						}
					});

				}
			},
			created:function(){
				this.getAreas();

				$("#form-shelfInfo-add").validate({
					rules:{
						xxxx:{
							required:true,
						},
					},
					focusCleanup: true
				});
			},

		})



	</script>
</body>
</html>































